DEFINITION MODULE StandardIO;


(*
*    Copyright (c) 1985,1986,1987,1988,1989 by
*    ana-systems, Foster City, California.
*    All Rights Reserved.
*
*    This software is furnished under a license and may be used and copied
*    only  in accordance with  the  terms  of  such  license and  with the
*    inclusion of the above copyright notice.  This software or  any other
*    copies thereof may not be provided or otherwise made available to any
*    other  person.   No title to and ownership of the  software is  herby
*    transferred.
*
*    The information in this software is  subject to change without notice
*    and  should  not be construed as a commitment by ana-systems.   No
*    warranty is implied or expressed.
*
*  SCCID  = "1.1    1/26/86"; 
*)
FROM Files IMPORT File;

EXPORT QUALIFIED
    SetInput,       GetInput,       SetOutput,      GetOutput,
    EchoMode,       SetEchoMode,    GetEchoMode,
    GetErrorInput,  GetErrorOutput,
    LogMode,        SetLogMode,     GetLogMode,
    SetLog,         GetLog;

(* Standard system input and output files *)

PROCEDURE SetInput       (     input       : File );
(* Sets the standard input to the value of input *)

PROCEDURE GetInput       ( VAR input       : File );
(* Gets the current handle for the standard input File *)

PROCEDURE SetOutput      (     output      : File );
(* Sets the standard output to the value of Output *)

PROCEDURE GetOutput      ( VAR output      : File );
(* Gets the current handle for the standard output File *)


(* control of echoing from standard input to standard output *)

TYPE
    EchoMode = (echo, noEcho);

PROCEDURE SetEchoMode    (     mode        : EchoMode);
(* If "mode" is "echo", causes the standard input to be echoed to the
   current standard output file *)

PROCEDURE GetEchoMode    ()                : EchoMode;
(* returns the current value of echo mode *)


PROCEDURE GetErrorOutput ( VAR errorFile   : File );
(* Error output is the file to which error messages are sent *)

PROCEDURE GetErrorInput  ( VAR errorFile   : File );
(* Error input is the file to which a user must respond after an error has
   occured ("press <space> to continue"). Abort, Retry, Ignore *)


(* Chars written or echoed to the Output file may be copied to the Log file.
   This allows input to be copied to two output files for "photo sessions"
   *)

TYPE
    LogMode = (loggingOn, loggingOff);

PROCEDURE SetLog         (     log         : File);

PROCEDURE GetLog         ( VAR log         : File );

PROCEDURE SetLogMode     (     mode        : LogMode);

PROCEDURE GetLogMode     ()                : LogMode;

END StandardIO.
